#!/bin/bash

ICON="🔋"
ICONc="🔌"
read -r capacity </sys/class/power_supply/BAT0/capacity
read -r status </sys/class/power_supply/BAT0/status

if [ "${status}" = "Charging" ]; then
    printf "${ICONc} %s%%|" "${capacity}"
else
    printf "${ICON} %s%%|" "${capacity}"
fi

# EOF

